import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/third_party_contractor_entity.dart';

ThirdPartyContractorEntity $ThirdPartyContractorEntityFromJson(Map<String, dynamic> json) {
  final ThirdPartyContractorEntity thirdPartyContractorEntity = ThirdPartyContractorEntity();
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    thirdPartyContractorEntity.address = address;
  }
  final String? blacklistReason = jsonConvert.convert<String>(json['blacklistReason']);
  if (blacklistReason != null) {
    thirdPartyContractorEntity.blacklistReason = blacklistReason;
  }
  final String? businessLicense = jsonConvert.convert<String>(json['businessLicense']);
  if (businessLicense != null) {
    thirdPartyContractorEntity.businessLicense = businessLicense;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    thirdPartyContractorEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    thirdPartyContractorEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    thirdPartyContractorEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    thirdPartyContractorEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    thirdPartyContractorEntity.deleted = deleted;
  }
  final String? districtCode = jsonConvert.convert<String>(json['districtCode']);
  if (districtCode != null) {
    thirdPartyContractorEntity.districtCode = districtCode;
  }
  final String? headPersonId = jsonConvert.convert<String>(json['headPersonId']);
  if (headPersonId != null) {
    thirdPartyContractorEntity.headPersonId = headPersonId;
  }
  final String? headPersonName = jsonConvert.convert<String>(json['headPersonName']);
  if (headPersonName != null) {
    thirdPartyContractorEntity.headPersonName = headPersonName;
  }
  final String? headPersonPhone = jsonConvert.convert<String>(json['headPersonPhone']);
  if (headPersonPhone != null) {
    thirdPartyContractorEntity.headPersonPhone = headPersonPhone;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    thirdPartyContractorEntity.id = id;
  }
  final String? periodOfServiceEnd = jsonConvert.convert<String>(json['periodOfServiceEnd']);
  if (periodOfServiceEnd != null) {
    thirdPartyContractorEntity.periodOfServiceEnd = periodOfServiceEnd;
  }
  final String? periodOfServiceStart = jsonConvert.convert<String>(json['periodOfServiceStart']);
  if (periodOfServiceStart != null) {
    thirdPartyContractorEntity.periodOfServiceStart = periodOfServiceStart;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    thirdPartyContractorEntity.status = status;
  }
  final String? thirdCode = jsonConvert.convert<String>(json['thirdCode']);
  if (thirdCode != null) {
    thirdPartyContractorEntity.thirdCode = thirdCode;
  }
  final String? thirdKind = jsonConvert.convert<String>(json['thirdKind']);
  if (thirdKind != null) {
    thirdPartyContractorEntity.thirdKind = thirdKind;
  }
  final String? thirdKindLabel = jsonConvert.convert<String>(json['thirdKindLabel']);
  if (thirdKindLabel != null) {
    thirdPartyContractorEntity.thirdKindLabel = thirdKindLabel;
  }
  final String? thirdName = jsonConvert.convert<String>(json['thirdName']);
  if (thirdName != null) {
    thirdPartyContractorEntity.thirdName = thirdName;
  }
  final String? thirdType = jsonConvert.convert<String>(json['thirdType']);
  if (thirdType != null) {
    thirdPartyContractorEntity.thirdType = thirdType;
  }
  final String? thirdTypeLabel = jsonConvert.convert<String>(json['thirdTypeLabel']);
  if (thirdTypeLabel != null) {
    thirdPartyContractorEntity.thirdTypeLabel = thirdTypeLabel;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    thirdPartyContractorEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    thirdPartyContractorEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    thirdPartyContractorEntity.updateDate = updateDate;
  }
  final String? uploadCompanyCode = jsonConvert.convert<String>(json['uploadCompanyCode']);
  if (uploadCompanyCode != null) {
    thirdPartyContractorEntity.uploadCompanyCode = uploadCompanyCode;
  }
  final int? arrivalRate = jsonConvert.convert<int>(json['arrivalRate']);
  if (arrivalRate != null) {
    thirdPartyContractorEntity.arrivalRate = arrivalRate;
  }
  final int? controlRate = jsonConvert.convert<int>(json['controlRate']);
  if (controlRate != null) {
    thirdPartyContractorEntity.controlRate = controlRate;
  }
  final List<String>? businessLicenseList = (json['businessLicenseList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (businessLicenseList != null) {
    thirdPartyContractorEntity.businessLicenseList = businessLicenseList;
  }
  return thirdPartyContractorEntity;
}

Map<String, dynamic> $ThirdPartyContractorEntityToJson(ThirdPartyContractorEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['address'] = entity.address;
  data['blacklistReason'] = entity.blacklistReason;
  data['businessLicense'] = entity.businessLicense;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['districtCode'] = entity.districtCode;
  data['headPersonId'] = entity.headPersonId;
  data['headPersonName'] = entity.headPersonName;
  data['headPersonPhone'] = entity.headPersonPhone;
  data['id'] = entity.id;
  data['periodOfServiceEnd'] = entity.periodOfServiceEnd;
  data['periodOfServiceStart'] = entity.periodOfServiceStart;
  data['status'] = entity.status;
  data['thirdCode'] = entity.thirdCode;
  data['thirdKind'] = entity.thirdKind;
  data['thirdKindLabel'] = entity.thirdKindLabel;
  data['thirdName'] = entity.thirdName;
  data['thirdType'] = entity.thirdType;
  data['thirdTypeLabel'] = entity.thirdTypeLabel;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['uploadCompanyCode'] = entity.uploadCompanyCode;
  data['arrivalRate'] = entity.arrivalRate;
  data['controlRate'] = entity.controlRate;
  data['businessLicenseList'] = entity.businessLicenseList;
  return data;
}

extension ThirdPartyContractorEntityExtension on ThirdPartyContractorEntity {
  ThirdPartyContractorEntity copyWith({
    String? address,
    String? blacklistReason,
    String? businessLicense,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? districtCode,
    String? headPersonId,
    String? headPersonName,
    String? headPersonPhone,
    String? id,
    String? periodOfServiceEnd,
    String? periodOfServiceStart,
    String? status,
    String? thirdCode,
    String? thirdKind,
    String? thirdKindLabel,
    String? thirdName,
    String? thirdType,
    String? thirdTypeLabel,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? uploadCompanyCode,
    int? arrivalRate,
    int? controlRate,
    List<String>? businessLicenseList,
  }) {
    return ThirdPartyContractorEntity()
      ..address = address ?? this.address
      ..blacklistReason = blacklistReason ?? this.blacklistReason
      ..businessLicense = businessLicense ?? this.businessLicense
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..districtCode = districtCode ?? this.districtCode
      ..headPersonId = headPersonId ?? this.headPersonId
      ..headPersonName = headPersonName ?? this.headPersonName
      ..headPersonPhone = headPersonPhone ?? this.headPersonPhone
      ..id = id ?? this.id
      ..periodOfServiceEnd = periodOfServiceEnd ?? this.periodOfServiceEnd
      ..periodOfServiceStart = periodOfServiceStart ?? this.periodOfServiceStart
      ..status = status ?? this.status
      ..thirdCode = thirdCode ?? this.thirdCode
      ..thirdKind = thirdKind ?? this.thirdKind
      ..thirdKindLabel = thirdKindLabel ?? this.thirdKindLabel
      ..thirdName = thirdName ?? this.thirdName
      ..thirdType = thirdType ?? this.thirdType
      ..thirdTypeLabel = thirdTypeLabel ?? this.thirdTypeLabel
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..uploadCompanyCode = uploadCompanyCode ?? this.uploadCompanyCode
      ..arrivalRate = arrivalRate ?? this.arrivalRate
      ..controlRate = controlRate ?? this.controlRate
      ..businessLicenseList = businessLicenseList ?? this.businessLicenseList;
  }
}
